import request from '@/utils/axios';
import appName from "@/api/appName";

// 获取问答树
export function getQaTreeApi(params) {
    return request({
      url: appName.HQNR+'/qaTree/getQaTree',
      method: 'post',
      data: params
    })
}

// 获取参数组编码获取参数列表
export function getParamPageListApi(params) {
    return request({
      url: appName.HQNR+'/common/param/pageList',
      method: 'post',
      data: params
    })
}


// 新增或修改问题
export function insertOrUpdateQuestionApi(params) {
    return request({
      url: appName.HQNR+'/qaTree/question/insertOrUpdate',
      method: 'post',
      data: params
    })
}

// 根据id获取问题数据
export function getByIdQuestionApi(params) {
  return request({
    url: appName.HQNR+'/qaTree/question/getById',
    method: 'post',
    data: params
  })
}


// 新增或编辑答案
export function insertOrUpdateAnswerApi(params) {
  return request({
    url: appName.HQNR+'/qaTree/answer/insertOrUpdate',
    method: 'post',
    data: params
  })
}

// 获取问题列表
export function getQuestionListApi(params) {
  return request({
    url: appName.HQNR+'/qaTree/question/list',
    method: 'post',
    data: params
  })
}

// 删除问题
export function removeQuestionApi(params) {
  return request({
    url: appName.HQNR+'/qaTree/question/removeById',
    method: 'post',
    data: params
  })
}

// 删除答案
export function removeAnswerApi(params) {
  return request({
    url: appName.HQNR+'/qaTree/answer/removeById',
    method: 'post',
    data: params
  })
}